package homework.printyourself.info.items;

import homework.printyourself.info.BaseObject;
import homework.printyourself.info.items.utils.Gender;
import homework.valid.ForcedInput;
import homework.valid.validators.ValidateChain;
import homework.valid.validators.impl.EnumValidator;

import java.util.ArrayList;


public abstract class BaseInformationItem extends BaseObject {
    String itemName;
    String itemValue;
    private BaseObject obj;

    // XXX: 或许不应该放在基类中
    protected static ValidateChain chain;
    protected static ForcedInput fi = new ForcedInput();

    public BaseInformationItem(BaseObject obj, String value) {
        itemValue = value;
        this.obj = obj;
    }

    @Override
    public String getDescription() {
        return itemName+": "+itemValue+"\n";
    }

    @Override
    public String getAllDescription() {
        return obj.getAllDescription() + getDescription();
    }

    @Override
    public ArrayList<String> getDescriptionChain() {
        ArrayList<String> list = obj.getDescriptionChain();
        list.add(getDescription());
        return list;
    }

    @Override
    public String toString() {
        return getAllDescription();
    }

    public static ValidateChain getValidateChain() {
        return chain;
    }
}
